Executable Set Theory and Arithmetic Encodings in Prolog

نویسنده

  • Paul Tarau
چکیده

The paper is organized as a self-contained literate Prolog program that implements elements of an executable finite set theory with focus on combinatorial generation and arithmetic encodings. The complete SWI-Prolog tested code is available at http://logic.csci.unt.edu/tarau/research/2008/pHFS.zip. First, ranking and unranking functions for some “mathematically elegant” data types in the universe of Hereditarily Finite Sets with Urelements are provided, resulting in arithmetic encodings for powersets, hypergraphs, ordinals and choice functions. After implementing a digraph representation of Hereditarily Finite Sets we define decoration functions that can recover well-founded sets from encodings of their associated acyclic digraphs. We conclude with an encoding of arbitrary digraphs and discuss a concept of duality induced by the set membership relation. In the process, we uncover the surprising possibility of internally sharing isomorphic objects, independently of their language level types and meanings.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

A Functional Hitchhiker's Guide to Hereditarily Finite Sets, Ackermann Encodings and Pairing Functions

The paper is organized as a self-contained literate Haskell program that implements elements of an executable finite set theory with focus on combinatorial generation and arithmetic encodings. The code, tested under GHC 6.6.1, is available at http://logic.csci.unt.edu/tarau/ research/2008/fSET.zip. We introduce ranking and unranking functions generalizing Ackermann’s encoding to the universe of...

متن کامل

Ranking and Unranking of Hereditarily Finite Functions and Permutations

Prolog’s ability to return multiple answers on backtracking provides an elegant mechanism to derive reversible encodings of combinatorial objects as Natural Numbers i.e. ranking and unranking functions. Starting from a generalization of Ackerman’s encoding of Hereditarily Finite Sets with Urelements and a novel tupling/untupling operation, we derive encodings for Finite Functions and use them a...

متن کامل

An Axiomatic Approach to Computer Arithmetic

Different kinds of computer arithmetic follow an abstract mathematical pattern and are just special realizations of it. The basic mathematical concepts are sketched here. The concepts of rounding, of a screen, and of rounded arithmetic operations are defined in an axiomatic manner fully independent of special data formats and encodings. These abstract concepts are then applied and illustrated b...

متن کامل

A Hitchhiker's Guide to Reinventing a Prolog Machine

We take a fresh, “clean-room” look at implementing Prolog by deriving its translation to an executable representation and its execution algorithm from a simple Horn Clause meta-interpreter. The resulting design has some interesting properties: • the heap representation of terms and the abstract machine instruction encodings are the same • no dedicated code area is used as the code is placed dir...

متن کامل

Computing with Hereditarily Finite Sequences

We use Prolog as a flexible meta-language to provide executable specifications of some fundamental mathematical objects and their transformations. In the process, isomorphisms are unraveled between natural numbers and combinatorial objects (rooted ordered trees representing hereditarily finite sequences and rooted ordered binary trees representing Gödel’s System T types). This paper focuses on ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • CoRR

دوره abs/0808.0540  شماره 

صفحات  -

تاریخ انتشار 2008